package com.ygqh.baby.service.impl;

import com.ygqh.baby.mapper.LogRebateMapper;
import com.ygqh.baby.po.LogRebate;
import com.ygqh.baby.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by Administrator on 2016/8/25 0025.
 */
@Service
public class LogServiceImpl implements LogService {
    @Autowired
    private LogRebateMapper logRebateMapper;


    public void logRebate(String description,Long orderId) {
        LogRebate logRebate = new LogRebate();
        logRebate.setCreateTime(new Date());
        logRebate.setDescription(description);
        logRebate.setOrderId(orderId);
        logRebateMapper.insertSelective(logRebate);
    }
    public void logRebate(String description,String remark) {
        LogRebate logRebate = new LogRebate();
        logRebate.setCreateTime(new Date());
        logRebate.setDescription(description);
        logRebate.setRemark(remark);
        logRebateMapper.insertSelective(logRebate);
    }
    public void logRebate(String description, Long userId, Long orderId, BigDecimal price,  String priceType,  String rebateType, String remark) {
        LogRebate logRebate = new LogRebate();
        logRebate.setCreateTime(new Date());
        logRebate.setDescription(description);
        logRebate.setUserId(userId);
        logRebate.setPrice(price);
        logRebate.setPriceType(priceType);
        logRebate.setRebateType(rebateType);
        logRebate.setRemark(remark);
        logRebateMapper.insertSelective(logRebate);
    }

}
